<template>
	  <div>
	  	<van-nav-bar
		fixed="true"
	  	  left-arrow
	  	  @click-left="onClickLeft"
	  	/>
	  </div>
<div style="margin-top: 1rem;">
	<div style="float: left;">
			<van-tree-select
			  v-model:main-active-index="activeIndex"
			  height="155vw"
			  :items="items" 
			  @click="select(activeIndex)"
			>
			  <template #content>
				
				<van-skeleton v-for="i in 18" title :row="3" :loading="list.length<=0" style="background-color: white;"/>
			    <div style="width: 100%;"  v-for="(item,index) in list" >
					
					<van-card
					thumb="https://img.yzcdn.cn/vant/ipad.jpeg"
			    	  	:price="item.price"
			    	  	:title="item.title"
			    	>
			    	  <template #tags>
			    	    <van-tag plain type="success">{{item.type == 1 ? '上门检测':'上门护理'}}</van-tag><br />
			    	    <van-tag plain type="success">{{item.remarks}}</van-tag>
			    	  </template>
			    	  <template #footer>
			    	    <span>{{item.name}}></span>
			    	  </template>
			    	</van-card>
			    </div>
			    
			  </template>
			</van-tree-select>
	</div>
	
	
</div>
	
	
	
</template>


<script>
	import { ref } from 'vue';
	import { Toast } from 'vant';
	export default {
	setup() {
		const onClickLeft = () => history.back();
		const activeIndex = ref(0);
		  
	    return {
		  activeIndex,
		  items: [{ text: '上门核酸' }, { text: '上门体检' },{ text: '传染病检测' },
		  { text: '慢病检测' },{ text: '肿瘤早筛' }, { text: '专项检测' },
		  { text: '核酸团检' },{ text: '过敏原检测' }, { text: '小儿检测' },
		  { text: '上门换药' },{ text: '陪诊/陪护' }, { text: '小儿护理' },
		  { text: '日常护理' },{ text: '置管护理' }, { text: '打针/采血' },{text:'中医养生'}],
		  onClickLeft,
	    };
	  },
	  data(){
	  	return{
	  		list:[],
				}
			},
	   // mounted() {
	   			
	   // 			var then=this;
	   // 			this.axios.get("care/showlist").then((res) => {
	   // 			  console.log(res.data)
	   // 			  this.list = res.data;		
	   // 			})
	   			
	   // 		},
	   methods:{
		   select(activeIndex){
			this.list=[];
            // var that = this;
			this.axios.get("care/showlist").then((res) => {

			 		res.data.map(item=>{
			 		  	if(item.s_id===this.activeIndex+1){
							this.list.push(item);
			 		     }
			 		  });
					});
				},
			},
		}
	
	  
</script>
<style scoped>
	
	.van-sidebar-item--select::before{
	  background-color:#aaff7f;
	  
	}
	
	.van-sidebar {
	  width: var(--sidebar-width, 6rem);
	}
	
</style>
	
